#ifndef CAMERA_H
#define CAMERA_H

#include <QObject>
#include <QTimer>
#include <opencv/cv.h>
#include <stdlib.h>
#include "socketbase.h"
#include "robotStructs.h"

/*
  Camera is responsible for retrieving positions of robots and image
  from a server.

  TODO: retrieving image
  */
class Camera : public SocketBase
{
    Q_OBJECT
    ObjektListe positions;
    ComandPkg packetToWrite;
    IplImage *image;
    IplImage *newImage;
    bool isNewImage;

    const static int imageSize = sizeof(IplImage);
public:
    Camera(QObject *parent = 0);
    ~Camera();
    ObjektListe* getPositions();
    IplImage* getImage();
private:
    void writeData();
public slots:
    void sendRequest();
private slots:
    void readData();

};

#endif // CAMERA_H
